\setlength{\unitlength}{0.1mm}
\newcommand{\wa }{   0}
\newcommand{\wA }{  50}
\newcommand{\wb }{ 450}
\newcommand{\wB }{ 350}
\newcommand{\wbb}{ 400}
\newcommand{\wBB}{ 375}
\newcommand{\wc }{ 750}
\newcommand{\wcx}{ 850}
\newcommand{\we }{1050}
\newcommand{\waa}{ 300}
\newcommand{\wab}{ 400}
\newcommand{\wabx}{550}
\newcommand{\waby}{600}
\newcommand{\wac}{ 200}
\newcommand{\wbc}{ 700}
\newcommand{\wBC}{ 725}
\newcommand{\wcl}{ 950}
\newcommand{\wce}{1000}
\newcommand{\wcf}{ 950}

\begin{figure}
\begin{picture}(1370,1690)(0,-1630)

\subr{\wa}{   0}{w3wave}
\put(\waa,   30){\line(-1,0){100}}
\put(\waa,   30){\line(0,-1){1600}}

% Input / map processing routines

\put(350,-530){\dashbox{10}(950,620)[tr] {\small input~}}

\subx{\wb }{ -000}{w3ice3wncg}
\subr{\wcx}{ -000}{w3ucur}
\subx{\wb }{ -100}{ug\_gradients}
\subd{\wcx}{ -100}{w3dzxy / smcdxy}
\subr{\wb }{ -200}{w3uwnd}
\subr{\wc }{ -200}{w3uini}
\subr{\we }{ -200}{w3iobc}
\subr{\wb }{ -300}{w3ubpt}
\subr{\wc }{ -300}{w3uice}
\subr{\we }{ -300}{w3ulev}
\subn{\wb }{ -400}{w3map}
\subr{\wc }{ -400}{w3utrn}
\subr{\we }{ -400}{w3nmin}
\subr{\wb }{ -500}{w3cflug}
\subr{\wc }{ -500}{w3cflxy}
\subr{\we }{ -500}{w3nmin}
\put(\waa, -20){\line(1,0){100}}
\put(\wab,-420){\line(0,1){400}}
\put(\wab, -20){\line(1,0){550}}
\multiput(\waby, -40)(350,0){2}{\line(0,1){40}}
\put(\wab,-220){\line(1,0){750}}
\multiput(\wabx,-240)(300,0){3}{\line(0,1){40}}
\put(\wab,-420){\line(1,0){750}}
\multiput(\wabx,-440)(300,0){3}{\line(0,1){40}}

% Propagation

\put(350,-980){\dashbox{10}(950,420)[tl] {\small ~propagation}}

\subn{\wc}{ -650}{w3ktp}
\subx{\wbb}{ -700}{w3gath(smc)}
\subn{\wc}{ -750}{w3xyp}
\subr{\wc}{ -850}{w3xypug}
\subr{\wc}{ -950}{w3psmc}
\subx{\wbb}{ -900}{w3scat(smc)}
\subn{\we}{ -650}{w3qck}
\subn{\we}{ -750}{w3uno}

\put(\waa,-620){\line(1,0){450}}
\put(\wcl,-620){\line(1,0){100}}
\put(\wBB,-620){\line(0,-1){250}}
\multiput(\wBB,-870)(0,200){2}{\line(1,0){25}}
\put(\wBB,-770){\line(1,0){350}}
\put(\wcl,-720){\line(1,0){100}}
\put(\wce,-720){\line(0,1){100}}
\put(\wBC,-720){\line(0,-1){200}}
\multiput(\wBC,-920)(0,100){3}{\line(1,0){25}}
%\put(\wbc,-820){\line(1,0){ 50}}

% Source terms

\put(\wbc,-1630){\dashbox{10}(600,530)[tr] {\small source terms~}}

\subr{\wb}{-1070}{w3srce}
\subn{\wc}{-1200}{w3spr}
\subn{\we}{-1200}{w3flx}
\subn{\wc}{-1300}{w3sln}
\subn{\we}{-1300}{w3sin}
\subn{\wc}{-1400}{w3snl}
\subn{\we}{-1400}{w3sds}
\subn{\wc}{-1500}{w3swl}
\subn{\we}{-1500}{w3sbt}
\subn{\wc}{-1600}{w3sic}
\subr{\we}{-1600}{\ldots}

\put(\waa,-1040){\line(1,0){150}}
\put(\wce,-1040){\line(-1,0){350}}
\put(\wce,-1040){\line(0,-1){530}}
\multiput(\wce,-1170)(0,-100){5}{\line(-1,0){50}}
\multiput(\wce,-1170)(0,-100){5}{\line(1,0){50}}

% Output

\put(\wa,-1630){\dashbox{10}(600,530)[tl] {\small ~output}}

\subr{\wA}{-1200}{w3cprt}
\subr{\wB}{-1200}{w3outg}
\subr{\wA}{-1300}{w3iogo}
\subr{\wB}{-1300}{w3iope}
\subr{\wA}{-1400}{w3iopo}
\subr{\wB}{-1400}{w3iotr}
\subr{\wA}{-1500}{w3iors}
\subr{\wB}{-1500}{w3iobc}
\subr{\wA}{-1600}{w3iosf}
\multiput(\waa,-1170)(0,-100){5}{\line(-1,0){50}}
\multiput(\waa,-1170)(0,-100){4}{\line(1,0){50}}

\end{picture}

\caption{Subroutine structure for wave model routine without service routines,
         routines managing the data structures, and {\F mpi} routines. `{\ldots}'
         identifies additional source term routines.}
\label{fig:w3wave}

\end{figure}
